﻿using System.Collections.Generic;
using Newtonsoft.Json;
using ZYing.LiquidThemeEngine.Locales;

namespace ZYing.LiquidThemeEngine.Config.Schemas;

public class ThemeSectionSchema
{
    [JsonProperty("name")] public ILocalizableText Name { get; set; }
    [JsonProperty("tag")] public string Tag { get; set; }
    [JsonProperty("class")] public string Class { get; set; }
    [JsonProperty("settings")] public List<ThemeSettingItemSchema> Settings { get; set; }
    [JsonProperty("blocks")] public List<ThemeSectionBlockSchema> Blocks { get; set; }
    [JsonProperty("max_blocks")] public int? MaxBlocks { get; set; }
    [JsonProperty("presets")] public List<ThemeSectionPresetSetting> Presets { get; set; }
    [JsonProperty("default")] public ThemeSectionDefaultSetting Default { get; set; }

    public static ThemeSectionSchema Parse(string value)
    {
        return JsonConvert.DeserializeObject<ThemeSectionSchema>(value);
    }
}